import Vue from 'vue'
import Router from 'vue-router'
import before from './before'

Vue.use(Router)

const route = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
        {
            path: '/',
            name: 'home',
            component: () => import("../pages/Home.vue")
        }

        ,{
            path: '*',
            name: '404',
            component: () => import("../pages/Error/404.vue")
        }
    ]
})

route.beforeEach((to,from, next)=>{
    before(to,from, next, route)
})

export default route